-
Notifications
You must be signed in to change notification settings - Fork 219
(Re)subscribe to a channel with correct emitter #549
base: develop
Are you sure you want to change the base?
Conversation
…bject, to ensure future notifications are sent to the new emitter.
please check out |
would the doOnDispose() at line 378 (which removes the subscription from the map) not achieve the same result? |
Not really overlapping issues. That pull request is for auto-reconnect, which is great. However, it does not deal with the issue that (re-)subscriptions can fail for any reason (broken connection, rate limit, etc) and then subscriber would not be notified. Imagine subscribing for order books of 100 pairs and a rate-limited exchange (yes, Kraken, but also others). The first 20 or so subscriptions would be successful, but the rest would not. The connection is OK and there will be no auto-reconnect happening, to call the Now, since the For how |
This is a must feature in my opinion. Thank you @mladenmarkov for this PR. |
I was referring to (which is also in PR#542 )
|
#566 Also covers a related discussion |
This project is in the process of being merged into the XChange project and no further PRs will be merged here. Once the projects have been merged, there may be a short stabilization period where there will be large-scale renaming of classes and packages, which may cause conflicts. You are advised to wait at least a week from now and then resubmit your PR on the XChange project. Thank you for your support! |
You can now resubmit your PR on XChange. This project will shortly be marked as archived. |
When (re)subscribing to a channel and there's already a Subscription object created, it's being reused. However, it contains the old emitter, from a previous subscription attempt.
This pull request suggests to always create a new Subscription object, to ensure future notifications are sent to the new emitter. Otherwise, the new subscription will not receive any events whatsoever.
This change allows subscriptions to be retried automatically using the
retryWhen()
operator.